//
//  GroupSetTableViewCell.m
//  zhixinApp
//
//  Created by zhiguanzhl on 2017/11/23.
//  Copyright © 2017年 zhiguanzhl. All rights reserved.
//

#import "GroupSetTableViewCell.h"

@implementation GroupSetTableViewCell

- (void)awakeFromNib {
    [super awakeFromNib];
    // Initialization code
}

- (instancetype)initWithCoder:(NSCoder *)coder
{
    self = [super initWithCoder:coder];
    if (self) {
        self.selectionStyle = UITableViewCellSelectionStyleNone;
        self.userInteractionEnabled = YES;
        self.shouldIndentWhileEditing = NO;

    }
    return self;
}

- (IBAction)switchAction:(UISwitch *)sender {
    
    BOOL isButtonOn = [sender isOn];
    if (self.block) {
        self.block(isButtonOn);
    }
    
}
+ (instancetype)cellWithTableView:(UITableView *)tableView{
    static NSString *cellID = @"GroupSetTableViewCell";
    GroupSetTableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:cellID];
    if (!cell) {
        cell = [[NSBundle mainBundle]loadNibNamed:@"GroupSetTableViewCell" owner:self options:nil].lastObject;
    }
    return cell;
}
@end
